se = "hetero")
})
names(right.conspiracy) <- names.lc
names(right.conspiracy.bin) <- names.lc[-c(1,2)]
modelsummary::modelsummary(right.conspiracy,
coef_map = cmap,
gof_map = c("nobs","pseudo.r.squared",
"AIC","BIC","logLik",
"vcov.type"),
stars = c("*" = .1, "**" = .05, "***" = .001),
title = "Conspiracy Beliefs by Gun Ownership (New Owners vs. Pre-Existing Owners) (OLS)",
output = "tables/mod_right_conspiracy_table_c4.tex")
modelsummary::modelsummary(right.conspiracy.bin,
coef_map = cmap,
gof_map = c("nobs","pseudo.r.squared",
"AIC","BIC","logLik",
"vcov.type"),
stars = c("*" = .1, "**" = .05, "***" = .001),
title = "Conspiracy Beliefs by Gun Ownership (New Owners vs. Pre-Existing Owners) (Logit)",
output = "tables/mod_right_conspiracy_bin_table_c5.tex")
etable(right.conspiracy,
title = "Conspiracy Beliefs by Gun Ownership (New Owners vs. Pre-Existing Owners) (OLS)",
adjustbox = T,
replace = T,
file = "appendix_tables/c4.tex")
etable(right.conspiracy.bin,
title = "Conspiracy Beliefs by Gun Ownership (New Owners vs. Pre-Existing Owners) (Logit)",
adjustbox = T,
replace = T,
file = "appendix_tables/c5.tex")
right.conspiracy.df <- tidy_many_outcomes(right.conspiracy,
list("trump_win", "vaccine_misinfo_index",
"vac_minfo_alter_dna", "vac_minfo_fetal_tissue",
"vac_minfo_microchips", "vac_minfo_infertility",
"vac_minfo_clinically_tested_NO"),
"new_owner") %>%
mutate(heading = "Effect of New Gun Owner \n(vs. Pre-Existing Gun Owner)")
# check pval for trump_win
summary(right.conspiracy[[1]])
farright.conspiracy <- lapply(c("trump_win", "vaccine_misinfo_index",
"vac_minfo_alter_dna", "vac_minfo_fetal_tissue",
"vac_minfo_microchips", "vac_minfo_infertility",
"vac_minfo_clinically_tested_NO"), function(x){
fixest::feglm(as.formula(paste0(x, "~ new_owner + ..controls")),
data = d.new.and.oldnobuy,
family = gaussian(),
se = "hetero")
})
farright.conspiracy.bin <- lapply(c("vac_minfo_alter_dna", "vac_minfo_fetal_tissue",
"vac_minfo_microchips", "vac_minfo_infertility",
"vac_minfo_clinically_tested_NO"), function(x){
fixest::feglm(as.formula(paste0(x, "~ new_owner + ..controls")),
data = d.new.and.oldnobuy,
family = "binomial",
se = "hetero")
})
# regression tables
names(farright.conspiracy) <- names.lc
names(farright.conspiracy.bin) <- names.lc[-c(1,2)]
modelsummary::modelsummary(farright.conspiracy,
coef_map = cmap,
gof_map = c("nobs","pseudo.r.squared",
"AIC","BIC","logLik",
"vcov.type"),
stars = c("*" = .1, "**" = .05, "***" = .001),
title = "Conspiracy Beliefs by Gun Ownership (New Gun Owners vs. Pre-Existing Gun Owners With No Pandemic Purchases) (OLS)",
output = "tables/mod_farright_conspiracy_table_c6.tex")
modelsummary::modelsummary(farright.conspiracy.bin,
coef_map = cmap,
gof_map = c("nobs","pseudo.r.squared",
"AIC","BIC","logLik",
"vcov.type"),
stars = c("*" = .1, "**" = .05, "***" = .001),
title = "Conspiracy Beliefs by Gun Ownership (New Gun Owners vs. Pre-Existing Gun Owners With No Pandemic Purchases) (Logit)",
output = "tables/mod_farright_conspiracy_bin_table_c7.tex")
etable(farright.conspiracy,
title = "Conspiracy Beliefs by Gun Ownership (New Gun Owners vs. Pre-Existing Gun Owners With No Pandemic Purchases) (OLS)",
adjustbox = T,
replace = T,
file = "appendix_tables/c6.tex")
etable(farright.conspiracy.bin,
title = "Conspiracy Beliefs by Gun Ownership (New Gun Owners vs. Pre-Existing Gun Owners With No Pandemic Purchases) (Logit)",
adjustbox = T,
replace = T,
file ="appendix_tables/c7.tex")
farright.conspiracy.df <- tidy_many_outcomes(
farright.conspiracy,
list("trump_win", "vaccine_misinfo_index",
"vac_minfo_alter_dna", "vac_minfo_fetal_tissue",
"vac_minfo_microchips", "vac_minfo_infertility",
"vac_minfo_clinically_tested_NO"),
"new_owner") %>%
mutate(heading = "Effect of New Gun Owner \n(vs. Pre-Existing Gun Owner who \ndid not buy in pandemic)")
conspiracy.df <- bind_rows(left.conspiracy.df,
right.conspiracy.df,
farright.conspiracy.df) %>%
mutate(dv = fct_rev(fct_inorder(fct_recode(
dv,
"Trump Won 2020 Election" = "trump_win",
"Vaccine Conspiracy Index" = "vaccine_misinfo_index",
"Conspiracy: Vaccine Alters DNA" = "vac_minfo_alter_dna",
"Conspiracy: Vaccine Contains Fetal Tissue" = "vac_minfo_fetal_tissue",
"Conspiracy: Vaccine Contains Microchips" = "vac_minfo_microchips",
"Conspiracy: Vaccine Causes Infertility" = "vac_minfo_infertility",
"Conspiracy: Vaccine Not Tested" = "vac_minfo_clinically_tested_NO"))),
heading = fct_inorder(heading))
figure_2 <- ggplot(data = conspiracy.df) +
geom_pointrange(aes(y=dv, x = estimate,
xmin = conf.low, xmax = conf.high)) +
geom_linerange(aes(y=dv,
xmin = conf.low.inner,
xmax = conf.high.inner),
size = 1.5) +
geom_vline(xintercept = 0, lty = "dashed") +
facet_wrap(vars(heading)) +
theme_forest() +
labs(x = "Estimate", y = "Outcome",
title = "Figure 2: Conspiracy beliefs among existing and new gun owners",
subtitle = "Estimates from linear regressions with controls (not shown). 90% and 95% uncertainty intervals use robust standard errors.")
ggsave(figure_2, file = "figures/Figure_2.pdf", width = 13, height = 5)
left.trust <- lapply(c("trust_news_media", "trust_gov_health_index",
"trust_scientists"), function(x){
fixest::feglm(as.formula(paste0(x, "~ existing_owner + ..controls")),
data = d.no.new.owners,
family = gaussian(),
se = "hetero")
})
names(left.trust) <- paste("Trust:", c("News Media","Health Officials","Scientists"))
modelsummary::modelsummary(left.trust,
coef_map = cmap,
gof_map = c("nobs","pseudo.r.squared",
"AIC","BIC","logLik",
"vcov.type"),
stars = c("*" = .1, "**" = .05, "***" = .001),
title = "Trust by Gun Ownership (Pre-Existing Owners vs. Non-Owners)",
output = "tables/left_trust_table_c8.tex")
etable(left.trust,
adjustbox = .7,
replace = T,
title = "Trust by Gun Ownership (Pre-Existing Owners vs. Non-Owners)",
file = "appendix_tables/c8.tex")
left.trust.df <- tidy_many_outcomes(left.trust,
list("trust_news_media", "trust_gov_health_index", "trust_scientists"),
"existing_owner") %>%
mutate(heading = "Effect of Pre-Existing Gun Owner \n(vs. Non-Owner)")
right.trust <- lapply(c("trust_news_media", "trust_gov_health_index",
"trust_scientists"), function(x){
fixest::feglm(as.formula(paste0(x, "~ new_owner + ..controls")),
data = d.all.owners,
family = gaussian(),
se = "hetero")
})
names(right.trust) <- paste("Trust:", c("News Media","Health Officials","Scientists"))
modelsummary::modelsummary(right.trust,
coef_map = cmap,
gof_map = c("nobs","pseudo.r.squared",
"AIC","BIC","logLik",
"vcov.type"),
stars = c("*" = .1, "**" = .05, "***" = .001),
title = "Trust by Gun Ownership (New Owners vs. Pre-Existing Owners)",
output = "tables/right_trust_table_c9.tex")
etable(right.trust,
adjustbox = .7,
replace = T,
title = "Trust by Gun Ownership (New Owners vs. Pre-Existing Owners)",
file = "appendix_tables/c9.tex")
right.trust.df <- tidy_many_outcomes(right.trust,
list("trust_news_media", "trust_gov_health_index", "trust_scientists"),
"new_owner") %>%
mutate(heading = "Effect of New Gun Owner \n(vs. Pre-Existing Gun Owner)")
farright.trust <- lapply(c("trust_news_media", "trust_gov_health_index",
"trust_scientists"), function(x){
fixest::feglm(as.formula(paste0(x, "~ new_owner + ..controls")),
data = d.new.and.oldnobuy,
family = gaussian(),
se = "hetero")
})
names(farright.trust) <- paste("Trust:", c("News Media","Health Officials","Scientists"))
modelsummary::modelsummary(farright.trust,
coef_map = cmap,
gof_map = c("nobs","pseudo.r.squared",
"AIC","BIC","logLik",
"vcov.type"),
stars = c("*" = .1, "**" = .05, "***" = .001),
title = "Trust by Gun Ownership (New Owners vs. Pre-Existing Owners With No Pandemic Purchases)",
output = "tables/farright_trust_table_c10.tex")
etable(farright.trust,
title = "Trust by Gun Ownership (New Owners vs. Pre-Existing Owners With No Pandemic Purchases)",
adjustbox = .7,
replace = T,
file = "appendix_tables/c10.tex")
farright.trust.df <- tidy_many_outcomes(farright.trust,
list("trust_news_media", "trust_gov_health_index", "trust_scientists"),
"new_owner") %>%
mutate(heading = "Effect of New Gun Owner \n(vs. Pre-Existing Gun Owner who \ndid not buy in pandemic)")
trust.df <- bind_rows(left.trust.df, right.trust.df, farright.trust.df) %>%
mutate(dv = fct_rev(fct_inorder(fct_recode(
dv,
"Trust Health Officials" = "trust_gov_health_index",
"Trust Scientists" = "trust_scientists",
"Trust News Media" = "trust_news_media"))),
heading = fct_inorder(heading))
figure_3 <-
ggplot(data = trust.df) +
geom_pointrange(aes(y=dv,
x = estimate,
xmin = conf.low,
xmax = conf.high)) +
geom_linerange(aes(y=dv,
xmin = conf.low.inner,
xmax = conf.high.inner),
size = 1.5) +
geom_vline(xintercept = 0, lty = "dashed") +
facet_wrap(vars(heading)) +
theme_forest()  +
labs(x = "Estimate", y = "Outcome",
title = "Figure 3: Institutional trust among existing and new gun owners",
subtitle = "Linear regression with controls (not shown). 90% and 95% uncertainty intervals use robust standard errors.")
ggsave(figure_3, file = "figures/Figure_3.pdf", width = 14, height = 5)
mod.reasons.agg <- lapply(c("(reason_hunt == 1 | reason_shoot == 1)",
"(reason_crime == 1|reason_gov == 1|reason_covid == 1 |reason_lockdown == 1|reason_election == 1|reason_protection == 1)",
"reason_other"), function(x){
fixest::feglm(as.formula(paste0(x, "~ new_owner + ..controls")),
data = d.buyers,
family = gaussian(),
se = "hetero")
})
mod.reasons.agg.bin <- lapply(c("(reason_hunt == 1 | reason_shoot == 1)",
"(reason_crime == 1|reason_gov == 1|reason_covid == 1 |reason_lockdown == 1|reason_election == 1|reason_protection == 1)",
"reason_other"), function(x){
fixest::feglm(as.formula(paste0(x, "~ new_owner + ..controls")),
data = d.buyers,
family = "binomial",
se = "hetero")
})
names.reasons.agg <- c("Hobbyist Reasons","Threat Reasons","Other")
names(mod.reasons.agg) <- names.reasons.agg
modelsummary::modelsummary(mod.reasons.agg,
coef_map = cmap,
gof_map = c("nobs","pseudo.r.squared",
"AIC","BIC","logLik",
"vcov.type"),
stars = c("*" = .1, "**" = .05, "***" = .001),
title = "Aggregated Reasons for Pandemic Gun Purchases (New Owners vs. Pre-Existing Owners) (OLS)",
output = "tables/mod_reasons_agg_table_c11.tex")
modelsummary::modelsummary(mod.reasons.agg.bin,
coef_map = cmap,
gof_map = c("nobs","pseudo.r.squared",
"AIC","BIC","logLik",
"vcov.type"),
stars = c("*" = .1, "**" = .05, "***" = .001),
title = "Aggregated Reasons for Pandemic Gun Purchases (New Owners vs. Pre-Existing Owners) (Logit)",
output = "tables/mod_reasons_agg_bin_table_c12.tex")
etable(mod.reasons.agg,
adjustbox = .4,
replace = T,
depvar = F,
headers = c("Hobby", "Threat", "Other"),
title = "Aggregated Reasons for Pandemic Gun Purchases (New Owners vs. Pre-Existing Owners) (OLS)",
file = "appendix_tables/c11.tex")
etable(mod.reasons.agg.bin,
adjustbox = .4,
replace = T,
depvar = F,
headers = c("Hobby", "Threat", "Other"),
title = "Aggregated Reasons for Pandemic Gun Purchases (New Owners vs. Pre-Existing Owners) (Logit)",
file = "appendix_tables/c12.tex")
mod.reasons.agg.df <- tidy_many_outcomes(mod.reasons.agg,
list("(reason_hunt == 1 | reason_shoot == 1)",
"(reason_crime == 1 | reason_gov == 1 | reason_covid == 1 | reason_lockdown == 1 | reason_election == 1 | reason_protection == 1)",
"reason_other"),
predictor = "new_owner") %>%
mutate(dv = fct_rev(fct_inorder(fct_recode(dv, "Hobbyist Reason(s)" = "(reason_hunt == 1 | reason_shoot == 1)",
"Threat Reason(s)" = "(reason_crime == 1 | reason_gov == 1 | reason_covid == 1 | reason_lockdown == 1 | reason_election == 1 | reason_protection == 1)",
"Other" = "reason_other"))),
header = "Effect of New Gun Owner (vs. Pre-Existing Gun Owner)
Sample: Respondents who bought guns from March 2020 onwards")
figure_4 <-
ggplot(data = mod.reasons.agg.df) +
geom_pointrange(aes(y=dv,
x = estimate,
xmin = conf.low,
xmax = conf.high)) +
geom_linerange(aes(y=dv,
xmin = conf.low.inner,
xmax = conf.high.inner),
size = 1.5) +
geom_vline(xintercept = 0, lty = "dashed") +
theme_forest()  +
facet_wrap(vars(header))+
scale_x_continuous(name = "Estimate",
breaks = c(-0.3, -0.25, -0.2, -0.15, -0.1, -0.05,
0, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3),
limits = c(-0.35, 0.35),
labels = c("-0.3","-0.25", "-0.2",
"0.15\n\nLikelier to be selected by pre-existing owners",
"-0.1", "0.05", "0", "0.05", "0.1",
"0.15\n\nLikelier to be selected by new owners",
"0.2","0.25", "0.3"))+
labs(title = "Figure 4: Reasons for purchasing guns during the pandemic",
subtitle = "Estimates from linear regression with controls (not shown). 90% and 95% uncertainty intervals use robust standard errors.",
y = "Outcome",
caption = 'Hobbyist reasons: "hunting", "target shooting"\nThreat reasons: "protection against crime," "protection against the government," "because of COVID-19," "because of lockdown and restrictions," "because of the election," "protection against someone I know personally"')+
theme(plot.caption = element_text(hjust = 0, size = 6))
ggsave(figure_4, file = "figures/Figure_4.pdf", width = 12, height = 5)
alpha.conspiracy <-
as_tibble(d) %>%
dplyr::select(vac_minfo_alter_dna,
vac_minfo_fetal_tissue,
vac_minfo_microchips,
vac_minfo_infertility,
vac_minfo_clinically_tested_NO) %>%
mutate_all(.funs = as.numeric) %>%
psych::alpha()
alpha.health.inst <-
as_tibble(d) %>%
dplyr::select(trust_CDC,
trust_fauci,
trust_FDA) %>%
mutate_all(.funs = as.numeric) %>%
psych::alpha()
alpha.hardship <-
as_tibble(d) %>%
dplyr::select(starts_with("ongoing")) %>%
dplyr::select(-ends_with("_index")) %>%
psych::alpha()
alpha.threat.reason <-
as_tibble(d) %>%
dplyr::select(reason_crime,
reason_gov,
reason_covid,
reason_lockdown,
reason_election,
reason_protection) %>%
filter(!is.na(reason_crime)) %>%
psych::alpha()
alpha.hobby.reason <-
as_tibble(d) %>%
dplyr::select(reason_hunt,
reason_shoot) %>%
filter(!is.na(reason_hunt)) %>%
psych::alpha()
stars <- c("***"=0.01, "**"=0.05, "*"=0.10)
robustness.misinfo <- lapply(c("trump_win", "vaccine_misinfo_index",
"vac_minfo_alter_dna", "vac_minfo_fetal_tissue",
"vac_minfo_microchips", "vac_minfo_infertility",
"vac_minfo_clinically_tested_NO"), function(x){
fixest::feglm(as.formula(paste0(x, "~ new_owner + ..controls")),
data = d.all.owners,
family = gaussian(),
se = "hetero")
})
etable(robustness.misinfo[c(1,2)],
title = "Correlates of Conspiracy Beliefs (All Owners)",
keep = c("owner", "Hardship","COVID"),
signifCode = stars,
file = "tables/table_1.tex")
names.rob.misinfo <- c("Trump Won","Vaccine Conspiracy Index")
names(robustness.misinfo)[c(1,2)] <- names.rob.misinfo
modelsummary::modelsummary(robustness.misinfo[c(1,2)],
coef_map = cmap,
gof_map = c("nobs","pseudo.r.squared",
"AIC","BIC","logLik",
"vcov.type"),
stars = c("*" = .1, "**" = .05, "***" = .001),
title = "Correlates of Conspiracy Beliefs (All Owners)",
output = "tables/table_1.html")
etable(robustness.misinfo[c(1,2)],
title = "Correlates of Conspiracy Beliefs (All Owners)",
keep = c("owner", "Hardship","COVID"),
signifCode = stars) %>%
kable(caption = "Sample: All Gun Owners") %>%
kable_classic(full_width = F, html_font = "Cambria")
robustness.trust <- lapply(c("trust_news_media", "trust_gov_health_index",
"trust_scientists"), function(x){
fixest::feglm(as.formula(paste0(x, "~ new_owner + ..controls")),
data = d.all.owners,
family = gaussian(),
se = "hetero")
})
etable(robustness.trust,
title = "Correlates of Institutional Trust (All Owners)",
keep = c("owner", "Hardship","COVID"),
signifCode = stars,
file = "tables/table_2.tex")
names.rob.trust<- paste("Trust:",c("News Media","Health Index","Scientists"))
names(robustness.trust) <- names.rob.trust
modelsummary::modelsummary(robustness.trust,
coef_map = cmap,
gof_map = c("nobs","pseudo.r.squared",
"AIC","BIC","logLik",
"vcov.type"),
stars = c("*" = .1, "**" = .05, "***" = .001),
title = "Correlates of Institutional Trust (All Owners)",
output = "tables/table_2.html")
etable(robustness.trust,
keep = c("owner", "Hardship","COVID"),
signifCode = stars ) %>%
kable(caption = "Sample:  All Gun Owners") %>%
kable_classic(full_width = F, html_font = "Cambria")
out1 <- tbl_svysummary(s,
statistic = list(all_continuous() ~ "{mean}",
all_categorical() ~ "{p}%"),
include = c("gender", "race", "urban_type", "age", "edu_", "income_brackets_4", "party", "ideo_fct_3", "trump_won", "existing_owner",
"new_owner"),
label = list(
edu_ ~ "Education",
urban_type ~ "Community",
income_brackets_4 ~ "Income Bracket",
ideo_fct_3 ~ "Ideology",
trump_won ~ "Trump won",
party ~ "Party",
age ~ "Age",
race ~ "Race",
gender ~ "Gender",
existing_owner ~ "Pre-Existing Owner",
new_owner ~ "New Owner"
),
missing = "no")
out2 <- tbl_svysummary(s %>% filter(existing_owner == 1),
statistic = list(all_continuous() ~ "{mean}",
all_categorical() ~ "{p}%"),
include = c("gender", "race", "urban_type", "age", "edu_", "income_brackets_4", "party", "ideo_fct_3", "trump_won", "existing_owner",
"new_owner"),
label = list(
edu_ ~ "Education",
urban_type ~ "Community",
income_brackets_4 ~ "Income Bracket",
ideo_fct_3 ~ "Ideology",
trump_won ~ "Trump won",
party ~ "Party",
age ~ "Age",
race ~ "Race",
gender ~ "Gender",
existing_owner ~ "Pre-Existing Owner",
new_owner ~ "New Owner"
),
missing = "no")
out3 <- tbl_svysummary(s %>% filter(gun_pan == 1),
statistic = list(all_continuous() ~ "{mean}",
all_categorical() ~ "{p}%"),
include = c("gender", "race", "urban_type", "age", "edu_", "income_brackets_4", "party", "ideo_fct_3", "trump_won", "existing_owner",
"new_owner"),
label = list(
edu_ ~ "Education",
urban_type ~ "Community",
income_brackets_4 ~ "Income Bracket",
ideo_fct_3 ~ "Ideology",
trump_won ~ "Trump won",
party ~ "Party",
age ~ "Age",
race ~ "Race",
gender ~ "Gender",
existing_owner ~ "Pre-Existing Owner",
new_owner ~ "New Owner"
),
missing = "no")
out4 <- tbl_svysummary(s %>% filter(new_owner == 1),
statistic = list(all_continuous() ~ "{mean}",
all_categorical() ~ "{p}%"),
include = c("gender", "race", "urban_type", "age", "edu_", "income_brackets_4", "party", "ideo_fct_3", "trump_won", "existing_owner",
"new_owner"),
label = list(
edu_ ~ "Education",
urban_type ~ "Community",
income_brackets_4 ~ "Income Bracket",
ideo_fct_3 ~ "Ideology",
trump_won ~ "Trump won",
party ~ "Party",
age ~ "Age",
race ~ "Race",
gender ~ "Gender",
existing_owner ~ "Pre-Existing Owner",
new_owner ~ "New Owner"
),
missing = "no")
out <- tbl_merge(list(out1, out2, out3, out4), c("**All Respondents**", "**Pre-Existing Gun Owners**",
"**Pandemic Purchasers**", "**New Owners**")) %>%
modify_header(
update = list(
label ~ "**Variable**"
)) %>%
modify_footnote(
update = all_stat_cols() ~ "Reweighted"
) %>%
modify_caption("**Sample Demographics**")
out <- tbl_merge(list(out1, out2, out3, out4), c("**All Respondents**", "**Pre-Existing Gun Owners**",
"**Pandemic Purchasers**", "**New Owners**")) %>%
modify_header(
update = list(
label ~ "**Variable**"
)) %>%
modify_footnote(
update = all_stat_cols() ~ "Reweighted"
) %>%
modify_caption("**Table A1: Sample Demographics**")
gtsave(out %>% as_gt(), filename = "a1.png")
gtsave(out %>% as_gt(), filename = "appendix_tables/a1.png")
\includegraphics[width=1.5\textwidth]{appendix_tables/a1}
robustness.misinfo
etable(robustness.misinfo[c(1,2)],
title = "Correlates of Conspiracy Beliefs (All Owners)",
keep = c("owner", "Hardship","COVID"),
signifCode = stars) %>%
kable(caption = "Sample: All Gun Owners") %>%
kable_classic(full_width = F, html_font = "Cambria")
robustness.misinfo[c(1,2)]
etable(robustness.misinfo[c(1,2)])
etable(robustness.misinfo)
etable(robustness.misinfo[c(1,2)])
robustness.misinfo
rm(list=ls())
